﻿using CPPEI.Coolzon.Common;
using CPPEI.Coolzon.Service.Contract;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.UI.Views.EventProxies
{
    public class RespMagnifySceneHandler : BaseResponseHandler<RespMagnifySceneData>
    {
        protected override void OnHandle(RemoteEventProxy remoteEventProxy, ServiceProxy.MainServiceRef.Response response, RespMagnifySceneData responseData)
        {
            //UI.Views.Events.NCLShowMagnifierEvent @event = new Events.NCLShowMagnifierEvent(
            //    responseData.IsEnable,
            //    responseData.SceneName,
            //    responseData.Rate,
            //    new System.Windows.Point(responseData.DestPointX, responseData.DestPointY),
            //    responseData.DestRadius,
            //    responseData.Duration);
            //@event.State = Events.NetEventState.Finished;
            //UI.Views.Events.NCLEventBus.Instance.PublishAsync(@event);
            if (responseData.IsEnable)
            {
                // 显示放大镜
                remoteEventProxy.RenderView.ShowMagnify(new System.Windows.Point(responseData.DestPointX, responseData.DestPointY),
                    responseData.Rate,
                    responseData.DestRadius,
                    responseData.Duration);
            }
            else
            {
                // 关闭放大镜
                remoteEventProxy.RenderView.HideMagnify();
            }
        }
    }
}
